import time


# 定义装饰器
def timer(func):
    def inner(self, prompt):
        # 内部函数对已有函数进行装饰
        # 获取时间距离1970-1-1:0:0:1的时间差
        begin = time.time()
        func(self, prompt)
        end = time.time()

        result = end - begin
        print("函数执行完成耗时:", result)

    return inner

class LLMEngine(object):
    def __init__(self, tokenizer = None):
        self.tokenizer = tokenizer

    @timer
    def execute(self, prompt):
        print(f"输入内容: {prompt}")

llm = LLMEngine()
llm.execute("Hi, who are you?")